package com.codergd.gra.service;

import com.codergd.gra.bean.Job;
import com.codergd.gra.dao.JobDao;
import com.codergd.gra.vo.JobCom;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JobService {
    @Autowired
    JobDao jobDao;

    //创建职位
    public int insertJob(Job job){
        return jobDao.insertJob(job);
    }

    //查询公司的权重
    public Integer selectWitByCom(int com){
        return jobDao.selectWitByCom(com);
    }
    //获取职位信息
    public List<Job> getJob(int com){
        return jobDao.getJob(com);
    }

    public Job getJobInfo(int id){
        return jobDao.getJobInfo(id);
    }

    //获取职位信息根据id
    public Job getJobById(int id){
        return jobDao.getJobById(id);
    }

    public List<JobCom> getJobByStr(String str){

        return jobDao.getJobByStr(str);
    }

    //修改职位信息
    public int updaeJob(Job job){
        return jobDao.updaeJob(job);
    }

    //删除职位信息
    public int deleteJob(int id){
        return jobDao.deleteJob(id);
    }

    //根绝个人信息获取职位
    public List<JobCom> getJobByUser(int sal, String job,int sal1, String job1,String address){
        return jobDao.getJobByUser(sal,job,sal1,job1,address);
    }

    //查询原来的权重
    public int selectWit(int id){
        return jobDao.selectWit(id);
    }

    //修改支付后的权重
    public int updateWit(int id,int wit){
        return jobDao.updateWit(id,wit);
    }

    //查询出权重不为0的职位
    public List<JobCom> getJobByWit(){
        return jobDao.getJobByWit();
    }
}
